<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
        a {
            color: inherit;
            text-decoration: none;
        }
        
        .box {
            width: 200px;
            height: 180px;
            border: 1px solid #000;
            margin: 100px auto;
        }
        
        .box p {
            width: 200px;
            height: 10px;
            line-height: 5px;
        }
        
        .box a {
            float: right;
        }
    </style>
</head>

<body>
    <div class="box">
        <p>
            我是小广告
            <a href="">x</a>
        </p>
    </div>

    <script>
        // 1,在页面上根据数据，动态创建表格
        /*  var arr = [{
                                              name: "Jack",
                                              age: 18,
                                              gender: "男",
                                          }, {
                                              name: "Rose",
                                              age: 20,
                                              gender: "女",
                                          }, {
                                              name: "Top",
                                              age: 22,
                                              gender: "男",
                                          }, ];

                                          function fn() {
                                              document.write("<table>");
                                              for (var i = 0; i < arr.length; i++) {
                                                  document.write("<tr>");
                                                  for (var key in arr[i]) {
                                                      document.write("<td>");
                                                      document.write(arr[i][key]);
                                                      document.write("</td>");
                                                  }
                                                  document.write("</tr>");
                                              }
                                              document.write("</table");
                                          }
                                          fn(); */

        // 3,实现流氓广告的关闭
    </script>
</body>

</html>